home *** CD-ROM | disk | FTP | other *** search
- Executes a command for each file in a set.
-
- FOR %var [/L] IN (set) DO [command [parameters] | BEGIN]
-
- %var specifies a parameter name.
- /L does not convert to upper case the filenames. This switch
- can be in any position before the "DO".
- set consists of one or more items. Each item is a filename (possibly
- wildcarded) or a directory name. File and directory names
- can be preceded by a volume and path spec.
- command is the command to be carried out for each file and can be
- the name of a batch file (possibly with volume and path spec).
- parameters are passed to the command or batch program being executed for
- each file.
-
- FOR %var IN (set) DO BEGIN
- is only allowed within a batch program. The lines following the FOR up
- to the corresponding "NEXT var" are executed for each file in the set.
- In this case, a global variable is created and the commands within the
- loop must refer to %var% (rather than %var) to obtain the current file
- name. It is up to the user to remove the variable after completing the
- batch program or within the program after exiting the FOR loop.
-